import pandas as pd

class expert_easySystem:
    def __init__(self, data):
        self.data = data

    def analyze(self):
        analysis_results = []
        recommendations = []
        n = 0
        for column_name, column_data in self.data.iteritems():
            if n > 0:
                result = f"Analyzing {column_name}: "
                recommendation = f"Recommendation for camera {column_name}: "

                # 示例参数：溶解氧 (DO)
                if float(column_data[7]) < 5:
                    result += "Low dissolved oxygen. "
                    recommendation += "Increase aeration. "
                elif float(column_data[7]) > 9:
                    result += "High dissolved oxygen. "
                    recommendation += "Decrease aeration. "
                else:
                    result += "Dissolved oxygen level is normal. "

                # 示例参数：pH值
                if float(column_data[8]) < 6.5:
                    result += "Low pH. "
                    recommendation += "Add alkaline substances. "
                elif float(column_data[8]) > 8.5:
                    result += "High pH. "
                    recommendation += "Add acidic substances. "
                else:
                    result += "pH level is normal. "

                # 示例参数：温度
                if float(column_data[9]) < 20:
                    result += "Low temperature. "
                    recommendation += "Increase water temperature. "
                elif float(column_data[9]) > 30:
                    result += "High temperature. "
                    recommendation += "Decrease water temperature. "
                else:
                    result += "Temperature level is normal. "

                analysis_results.append(result)
                recommendations.append(recommendation)
            n += 1
            continue
        return analysis_results, recommendations
